<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="cn.ac.cintcm.dataconverge.util.Constants,cn.ac.cintcm.dataconverge.researcher.domain.*,cn.ac.cintcm.dataconverge.util.*"%>
<%@ include file="/WEB-INF/jsp/taglib.jsp"%>
<%@ taglib prefix="ec" uri="/WEB-INF/taglib/extremecomponents.tld" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
List keyList = (List)request.getAttribute("keySubject");
Map keyMap = (Map)request.getAttribute("keyMap");
String  unitcity= (String)request.getAttribute("unitcity");
String  unittype= (String)request.getAttribute("unittype");
String  unitmajor= (String)request.getAttribute("unitmajor"); 

String  unitarea= (String)request.getAttribute("unitarea");
String  gzqy= (String)request.getAttribute("gzqy");
String  zddx= (String)request.getAttribute("zddx");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
	<link href="<%=basePath%>index/Themes/com/style.css" rel="stylesheet" type="text/css" />
    <script src="<%=basePath%>index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
      <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
      <script src='<%=basePath%>dwr/engine.js'></script>
     <script src='<%=basePath%>dwr/util.js'></script> 
     <script src='<%=basePath%>dwr/interface/subject.js'></script> 
  	<TITLE><%=Constants.APP_TITLE %>--修改单位信息</TITLE>
	<SCRIPT type="text/javascript">
	 function check(){
     	var fm=document.forms[0];
     if(fm.name.value==""){
	     alert("请填写单位名称！");
	     fm.name.focus();
	     return false;
     }
     if(fm.address.value==""){
	     alert("请填写单位地址！");
	     fm.address.focus();
	     return false;
     }
     if(fm.unitcity.value==""){
	     alert("请填写单位所在地！");
	     fm.unitcity.focus();
	     return false;
     }
      if(fm.contactuser.value==""){
	     alert("请填写单位联系人电话！");
	     fm.contactuser.focus();
	     return false;
     }
      if(fm.unitcode.value==""){
	     alert("请填写组织机构代码！");
	     fm.unitcode.focus();
	     return false;
     }
     return true;
     }
     
     function changeOrg(){
         var orgId = dwr.util.getText("unitcity"); 
         if(orgId != "0"){
            dwr.util.removeAllOptions("unitarea");
            subject.getAreaList(orgId,callBackForChange);
         }
      
      }
      function callBackForChange(dataStr){
         if(''!= dataStr){ 
          	dwr.util.addOptions("unitarea", eval(dataStr),'id','name');   
         }   
      }
      function setFormValue(){   
         var dept = '<%=unitarea==null?"":unitarea%>';  
         if(null != dept && ""!=dept){  
            dwr.util.setValue("unitarea",dept); 
         }  
      }
	</SCRIPT>
</head>
<body  class="idt_body" scroll="yes">
<form method="post" action="organization.htm?action=addOrganization&flag=mod" onSubmit="return check();">
 <table cellpadding="0" cellspacing="0" width="100%" height="100%" id="Table8">
 <input name="id" type="hidden" maxlength="128" value="${org.id}">
        <tr>
            <td valign="top" height="100%">
                <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" id="Table11">
                    <tr>
                        <td valign="top" >
                            <!------------------ 标题栏 ------------------>
                            <!--- 标题 ---->
                            <table class="idt_tle_mg" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                    <td class="idt_tle_i">
                                        <img id="imgForm6" src="<%=basePath%>index/Themes/com/idt_tle_o.gif"></td>
                                    <td class="idt_tle_f1">
                                        修改单位信息</td>
                                </tr>
                            </table>
                            <!--- 内容 --->
                            <div id="tdForm">
                              
                                  <table border="0" cellpadding="0" cellspacing="1" width="100%" class="idt_fim_mg">
                                    <tr>
                                        <td class="fim_l" width="15%">
                                           单位名称</td>
                                        <td class="fim_r" width="35%">
                                        <input name="name" style="width:95%" type="text" class="com_textbox"  maxlength="128" value="${org.name}"><font color="red">*</font>
                                        <td class="fim_l" width="15%">
                                           成立时间</td>
                                        <td class="fim_r" width="35%">
                                        	<input type="text" class="Wdate" id="unitstart"   style="width:99%" name="unitstart" value="${org.unitstart}"  onFocus="WdatePicker({el:'unitstart',dateFmt:'yyyy-MM-dd'})"/>
                                        </td>
                                    </tr>
                                     <tr>
                                       
                                        <td class="fim_l" width="15%">
                                           单位地址</td>
                                        <td class="fim_r" colspan="3">
                                        	<input name="address" style="width:98%" class="com_textbox" type="text" value="${org.address}" maxlength="128"><font color="red">*</font>
                                          </td>
                                    </tr>
                                        <tr>
                                        <td class="fim_l" width="15%">
                                           所在省份</td>
                                        <td class="fim_r" width="35%"> 
                                         <%out.print(DictHelper.getInst().selectStrarea(request.getSession().getServletContext(),"onchange='changeOrg();'","unitcity","width:97%",unitcity,"3"));%><font color="red">*</font>
                                        
                                        
                                          <td class="fim_l" width="15%">
                                           所在区</td>
                                        <td class="fim_r" width="35%">
                                          <select name="unitarea">
                                          <option value="0">--请选择所在地区--</option>
                                          </select>
                                          </td> 
                                          
                                      </tr>
                                        <tr>
                                        <td class="fim_l" width="15%">
                                           单位性质</td>
                                        <td class="fim_r" width="35%">
                                          <%out.print(DictHelper.getInst().selectStr(request.getSession().getServletContext(),"unittype","width:97%",unittype,"4"));%><font color="red">*</font>
                                       </td>
                                        <td class="fim_l" width="15%">
                                           组织代码</td>
                                        <td class="fim_r" width="35%">
                                        	<input name="unitcode" style="width:95%" class="com_textbox" value="${org.unitcode}" type="text" maxlength="128"><font color="red">*</font>
                                          </td>
                                    </tr>
                                    <tr>
                                        <td class="fim_l" width="15%">
                                           开户银行</td>
                                        <td class="fim_r" width="35%"> 
                                            <input name="kaihyh" style="width:95%" class="com_textbox" type="text" maxlength="128" value="${org.kaihuyh}">

                                         </td>
                                        
                                        <td class="fim_l" width="15%">
                                           银行账号</td>
                                        <td class="fim_r" width="35%">
                                        	<input name="yinhzh" style="width:95%" class="com_textbox" type="text" maxlength="128" value="${org.yhzh}">
                                          </td>
                                      </tr>
                                       <tr>
                                        <td class="fim_l" width="15%">
                                           国资企业</td>
                                        <td class="fim_r" width="35%"> 
                                        <%out.print(DictHelper.getInst().selectStr(request.getSession().getServletContext(),"gzqy","width:97%",gzqy,"99"));%>

                                         </td>
                                        
                                        <td class="fim_l" width="15%">
                                           重点大学</td>
                                        <td class="fim_r" width="35%">
                                        	  <%out.print(DictHelper.getInst().selectStr(request.getSession().getServletContext(),"zddx","width:97%",zddx,"99"));%>

                                          </td>
                                      </tr>
                                      <tr>
                                        <td class="fim_l" width="15%">
                                           单位主管部门</td>
                                        <td class="fim_r" width="35%">
                                        <%out.print(DictHelper.getInst().selectStr(request.getSession().getServletContext(),"unitmajor","width:97%",unitmajor,"10"));%> 
                                        <td class="fim_l" width="15%">
                                           电子邮箱</td>
                                        <td class="fim_r" width="35%">
                                        	<input name="unitmail" style="width:95%" value="${org.unitemail}" class="com_textbox" type="text" maxlength="128"> 
                                          </td>
                                    </tr>
                                    <tr>
                                        <td class="fim_l">
                                           联系电话</td>
                                        <td class="fim_r">
                                        <input name="phone" style="width:95%" class="com_textbox" value="${org.phone}" type="text" maxlength="20"> 
                                            </td>
                                        <td class="fim_l">
                                            传真</td>
                                        <td class="fim_r">
                                        <input name="fax" style="width:95%" class="com_textbox" value="${org.fax}" type="text" size="20">
                                          </td>
                                    </tr>
                                    <tr>
                                        <td class="fim_l">
                                           邮政编码</td>
                                        <td class="fim_r">
                                        <input name="postNo" style="width:95%" class="com_textbox" value="${org.postNo}" type="text" >
                                            </td>
                                        <td class="fim_l">
                                            网址</td>
                                        <td class="fim_r">
                                            <input class="com_textbox" style="width:95%" name="website" value="${org.website}" type="text" ></td>
                                    </tr>
                                     <!--  tr>
                                        <td class="fim_l">
                                           重点学科</td>
                                        <td class="fim_r" colspan="3">
                                         <select id="keySubject" name="keySubject" style="width:50%" size=3 multiple> 
                                         <%
							               for(int k = 0;k<keyList.size();k++){
							            	   SystemDict dict = (SystemDict)keyList.get(k);
							            	   out.println("<option value="+dict.getId()); 
							            	   out.println(">");
							            	   out.println(dict.getName());
							            	   out.println("</option>");
							               }
							             %>
                                         </select>
                                        </td>
                                    </tr-->
                                </table>
                                <table cellspacing="0" cellpadding="0" width="100%" class="idt_bottom_mg" border="0">
                                    <tr>
                                        <td align="right">
                                            <input  class="com_btn2" id="Button1" name="save" type="submit" value="保存">
                                            <input type="button" value="取消" name="B4" class="com_btn2" id="Button2" onclick="javascript:window.close();">
                                        </td>
                                    </tr><input name="ec_p" type="hidden" value="${ec_p}" />
                                </table>
                            </div>
                </table></form>
  </body>
</html>
<script>
changeOrg();
setFormValue();
</script>